package cn.edu.zafu.bigdata.cccnnn.worktwo;

import java.util.HashMap;

class StudentGradeManager {
    private HashMap<String,Integer>studentgn;

    public StudentGradeManager(){
        studentgn = new HashMap<>();

    }

    public void addStudent(String name, int grade){
        studentgn.put(name,grade);
    }

    public int getGrade(String name){

        return studentgn.getOrDefault(name, -1);
    }

    public void removeStudent(String name){
        studentgn.remove(name);
    }

}

public class TestStudentGradeManager{
    public static void main(String[] args){
        StudentGradeManager stu = new StudentGradeManager();
        stu.addStudent("vikey",88);
        stu.addStudent("lucy",93);


        System.out.println("vikey's grade: " +  stu.getGrade("vikey"));
        System.out.println("lucy's grade: " + stu.getGrade("lucy"));


        stu.removeStudent("vikey");
        System.out.println("vikey's grade after removal:"+stu.getGrade("vikey"));

    }
}